package com.taint.frame;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class LocalVariables<T> {
    private final ArrayList<Set<T>> arrayList;

    public LocalVariables() {
        arrayList = new ArrayList<>();
    }

    public void clear() {
        this.arrayList.clear();
    }

    public void add(Set<T> t) {
        this.arrayList.add(t);
    }


    public void add(T t) {
        Set set = new HashSet();
        set.add(t);
        this.arrayList.add(set);
    }

    public void set(int index, Set<T> t) {
        arrayList.set(index, t);
    }

    public void set(int index, T t) {
        Set<T> set = new HashSet<>();
        set.add(t);
        arrayList.set(index, set);
    }

    public Set<T> get(int index) {
        return arrayList.get(index);
    }

    public int size() {
        return this.arrayList.size();
    }

    public void remove(int index) {
        this.arrayList.remove(index);
    }

    public List<Set<T>> getList() {
        return this.arrayList;
    }


}
